package br.com.divulgaqui.service;

import javax.annotation.PostConstruct;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import br.com.divulgaqui.client.TelefoneServiceBeanLocal;
import br.com.divulgaqui.entity.Telefone;
import br.com.divulgaqui.persistence.dao.TelefoneDAO;
import br.com.divulgaqui.persistence.daoimpl.TelefoneDAOimpl;

@Stateless
public class TelefoneServiceBean implements TelefoneServiceBeanLocal {
	
	@PersistenceContext(unitName="divulgaqui")
	EntityManager entityManager;
	
	TelefoneDAO telefoneDAO;
	
	@PostConstruct
	void init(){
		telefoneDAO = new TelefoneDAOimpl(entityManager);
	}
	
	@Override
	public void salvar(Telefone telefone) {
		telefoneDAO.salvar(telefone);
	}

}
